#ifndef _METALL_AI_COMPONENT_H
#define _METALL_AI_COMPONENT_H

#include "IComponent.h"
#include <vector>

class ProjectileFactory;
class ProjectileComponent;
class VisualComponent;
class AnimationComponent;
class MetallAIComponent : public IComponent
{
public:
	MetallAIComponent(const std::string& p_target);
	virtual ~MetallAIComponent();

	virtual const std::string getType() { return "MetallAIComponent"; }
	virtual const std::string getFamilyType() { return "MetallAIComponent"; }

	virtual void init();
	virtual void update(const GameTime& p_gameTime);
	

protected:
	enum MetallAiState
	{
		AI_METALL_IDLE = 0,
		AI_METALL_POP_UP,
		AIT_METALL_POP_DOWN,
		AI_METALL_ATTACKING,
		AI_METALL_SIZE
	};

	typedef void (MetallAIComponent::*MetallAiStateFuncPtr)(const GameTime&);

	void idle(const GameTime&);
	void attacking(const GameTime&);
	void popUp(const GameTime&);

	std::string m_target;
	ProjectileFactory* m_projectileFactory;
	VisualComponent* m_visual;
	AnimationComponent* m_animations;
	float m_bulletVelocity;
	bool m_isShooting;
	int m_maxBullets;
	float m_timer;
	float m_delayShoot;
	int m_currentBulletCount;
	float m_activateDistance;

	int m_aiState;
	MetallAiStateFuncPtr m_aiFuncPtr[AI_METALL_SIZE];

};

#endif //_METALL_AI_COMPONENT_H